//
//  SDConstant.h
//  SinoDetectionDemo
//
//  Created by DCN1266 on 2022/4/18.
//

#import <Foundation/Foundation.h>

/// 设备类型枚举
typedef NS_ENUM(NSUInteger, SDCDeviceType) {
    /// 未知类型
    DEVICE_TYPE_UNKNOWN = 0,
    /// 安稳+Air血糖仪
    DEVICE_AQ_AIR_BLE = 1,
    /// UG-11系列蓝牙通讯协议
    DEVICE_UG_11_BLE = 2,
    /// 三诺标准蓝牙通讯协议V1
    DEVICE_SINO_STANDARD_BLE_01 = 3,
    /// 掌越血脂仪蓝牙通讯协议
    DEVICE_SLX_120_BLE = 4,
    /// 诺凡803血压计
    DEVICE_ONE_TEST_BPG_BLE = 5,
    /// wl-1 普通版
    DEVICE_WL_1_BLE = 6,
    /// ea,ka系列
    DEVICE_EAKA_BLE = 7,
    /// 乐福体脂、体重称
    DEVICE_SINO_BODY_SCALE_BLE = 8,
    /// 脉搏波血压计，9804,9805
    DEVICE_MAIBOBO_BPG_BLE = 9,
    /// 云康宝身高体重秤
    DEVICE_RUNCOBO_HEIGHT_WEIGHT_BLE = 10,
    /// 真睿二代
    DEVICE_TRUE_METRIX_AIR_BLE = 11,
    /// 金稳 + air
    DEVICE_JIN_WEN_AIR_BLE = 12,
    /// PCH50
    DEVICE_PCH50_BLE = 13,
    /// PCH100
    DEVICE_PCH100_BLE = 14,
    /// 卡迪克
    DEVICE_CARDIO_CHEK_BLE = 15,
    /// 诺凡-R181额温计
    DEVICE_AET_EXERGEN_BLE_NEW = 16,
    /// 血糖尿酸血压仪
    DEVICE_ONE_TEST_MULTI_BLE = 17
};

/// 命令字枚举
typedef NS_ENUM(NSUInteger, SDCCommandType) {
    /// 未知
    SDCCommandTypeUnknown = 0x00,
    /// 测试连接
    SDCCommandTypeTestConnect = 0x01,
    /// 错误状态
    SDCCommandTypeErrorState = 0x02,
    /// 滴血闪烁(ea-12设置时间指令)
    SDCCommandTypeDripBloodBlink = 0x03,
    /// 当前测试值
    SDCCommandTypeCurrentTestValue = 0x04,
    /// 读历史数据
    SDCCommandTypeReadHistoryData = 0x05,
    /// 设置时间
    SDCCommandTypeSetTime = 0x06,
    /// 读仪器ID号
    SDCCommandTypeReadDeviceId = 0x07,
    /// 清历史数据
    SDCCommandTypeClearHistoryData = 0x08,
    /// 设置校正码
    SDCCommandTypeSetCorrectCode = 0x09,
    /// 开始测试
    SDCCommandTypeStartTest = 0x0A,
    /// 仪器关机
    SDCCommandTypeShutDown = 0x0B,
    /// 仪器关蓝牙
    SDCCommandTypeTurnOffBluetooth = 0x0C,
    /// 读仪器SN号
    /// @note 真睿2代的命令字
    SDCCommandTypeReadDeviceSN = SDCCommandTypeReadDeviceId,
    /// 历史数据补发
    SDCCommandTypeHistoryDataReissue = 0x0E,
    /// 数据上传
    /// @note EA-12型、EA-18型和PCH-100的命令字
    SDCCommandTypeDataUpload = SDCCommandTypeClearHistoryData,
    ///  ea-12 ea-18 获取历史数据
    SDCComandTypeEA12EA18ReadHistoryData = SDCCommandTypeErrorState,
    /// 终端同步APP时间
    /// @note 爱立康RLF-A1的命令码
    SDCCommandTypeSyncTime = 0x30,
    /// 在线测量结果
    /// @note 爱立康RLF-A1的命令码
    SDCCommandTypeOnlineMeasResult = 0x31,
    /// 读取终端记忆温度数据
    /// @note 爱立康RLF-A1的命令码
    SDCCommandTypeReadMemTempData = 0x32,
    /// 删除记忆数据
    /// @note 爱立康RLF-A1的命令码
    SDCCommandTypeDeleteMemData = 0x33,
    /// 应用层回复血压计已经连接
    /// @note 安诺心的命令
    SDCCommandTypeConnected = 0xA0,
    /// 血压计通知开始测量
    /// @note 安诺心的命令
    SDCCommandTypeStartMeasuring = 0xB1,
    /// 血压计通知正在归零
    /// @note 安诺心的命令
    SDCCommandTypeZeroing = 0xB3,
    /// 血压计通知归零结束
    /// @note 安诺心的命令
    SDCCommandTypeZeroEnd = 0xB4,
    /// 血压计发送测量过程数据
    /// @note 安诺心的命令
    SDCCommandTypeMeasProcessData = 0xB7,
    /// 血压计发送测量结果
    /// @note 安诺心的命令
    SDCCommandTypeMeasurementResult = 0xB8,
    /// 血压计发送测量时间年月日
    /// @note 安诺心的命令
    SDCCommandTypeMeasurementYMD = 0xBD,
    /// 血压计发送测量时间时分（没有秒）
    /// @note 安诺心的命令
    SDCCommandTypeMeasurementHM = 0xBE,
    /// 应用层要求血压计开始测量
    /// @note 安诺心的命令
    SDCCommandTypeRequestToStartMeasuring = 0xA1,
    /// 应用层要求血压计停止测量
    /// @note 安诺心的命令
    SDCCommandTypeRequestToStopMeasuring = 0xA2,
    /// 应用层要求血压计关机
    /// @note 安诺心的命令
    SDCCommandTypeRequestToShutDown = 0xA6,
    /// 应用层设置血压计日期
    /// @note 安诺心的命令
    SDCCommandTypeSetDate = 0xA8,
    /// 应用层设置血压计时间
    /// @note 安诺心的命令
    SDCCommandTypeSinoHeartSetTime = 0xA9,
    /// 应用层读取血压计历史记录
    /// @note 安诺心的命令
    SDCCommandTypeReadHistoryRecords = 0xAC,
    /// 连接血压计
    /// @note 脉搏波血压计（RBP-9804）的命令
    SDCCommandTypeConnectBPMeter = 0x0101,
    /// hpa1c读历史数据序号
    SDCCommandTypeHistoryHPALCSerialNumber = 0x0501,
    /// hpa1c根据序号读历史数据
    SDCCommandTypeReadHPALCHistory = 0x0502,
    /// hpa1c
    SDCComandTypeOpenCloseSound = 0x0F,
    /// 碳系列获取仪器时间
    SDCComandTypeHPALCGetDeviceTime = SDCCommandTypeTurnOffBluetooth,
    /// 碳系列数据写入（调节音量，）
    SDCComandTypeHPALCSetValueData = 0x10,
    /// 碳系列写入数据读取
    SDCComandTypeHPALCGetValueData = 0x11,
    /// 多功能机开始测试
    SDCComandTypeOneTestMultiStartTest = 0x7001,
    /// 多功能机停止测量
    SDCComandTypeOneTestMultiStopTest = 0x7000,
};

/// 单位类型枚举
typedef NS_ENUM(NSUInteger, SDCUnitType) {
    /// 未知
    SDCUnitTypeUnknown = 0,
    /// mmol/L
    SDCUnitTypeMmol_L,
    /// mg/dL
    SDCUnitTypeMg_dL,
    /// umol/L
    SDCUnitTypeUmol_L,
    /// mg/L
    SDCUnitTypeMg_L,
    /// mg/g
    SDCUnitTypeMg_g,
    /// mg/mol
    SDCUnitTypeMg_mol,
    /// g/d
    SDCUNitTypeG_d,
    /// KG
    /// @note 体重秤单位类型
    SDCUnitTypeKG,
    /// 斤
    /// @note 体重秤单位类型
    SDCUnitTypeCatty,
    /// LB
    /// @note 体重秤单位类型
    SDCUnitTypeLB,
    /// ST:LB
    /// @note 体重秤单位类型
    SDCUnitTypeSTLB,
    /// 无单位
    /// @note 掌越单位类型
    SDCUnitTypeNo = 256
};

/// 样本类型枚举
typedef NS_ENUM(NSUInteger, SDCSampleType) {
    /// 未知
    SDCSampleTypeUnknown,
    /// 血液
    SDCSampleTypeBlood,
    /// 电阻条
    /// @note 安稳+Air的样本类型
    SDCSampleTypeResistanceStripe,
    /// 质控液
    SDCSampleTypeQCSolution = SDCSampleTypeResistanceStripe,
    /// 室间质评质控液
    SDCSampleTypeEQAQCSolution,
    /// 尿液
    SDCSampleTypeUrine
};

/// 测试项目枚举
typedef NS_ENUM(NSUInteger, SDCTestItemType) {
    /// 未知
    SDCTestItemTypeUnknown,
    /// 血糖
    SDCTestItemTypeBloodSugar,
    /// 尿酸
    SDCTestItemTypeUricAcid,
    /// 血酮
    SDCTestItemTypeBloodKetone,
    /// 总胆固醇
    SDCTestItemTypeTc,
    /// 高密度脂蛋白胆固醇
    SDCTestItemTypeHdl,
    /// 甘油三酯
    SDCTestItemTypeTg,
    /// 低密度脂蛋白胆固醇
    SDCTestItemTypeLdl,
    /// 非高密度脂蛋白胆固醇
    SDCTestItemTypeNonHdl,
    /// 总胆固醇与高密度脂蛋白胆固醇比
    SDCTestItemTypeTcHdl,
    /// 低密度脂蛋白胆固醇与高密度脂蛋白胆固醇比
    SDCTestItemTypeLdlHdl,
    ///  糖化血红蛋白
    SDcTestItemTypeTHXHDB
};

/// 数据类型枚举
typedef NS_ENUM(NSUInteger, SDCDataType) {
    /// 未知
    SDCDataTypeUnknown,
    /// 血糖
    SDCDataTypeBloodSugar,
    /// 血糖质控
    SDCDataTypeBloodSugarQC,
    /// 尿酸
    SDCDataTypeUricAcid,
    /// 尿酸质控
    SDCDataTypeUricAcidQC,
    /// 血酮血液值
    SDCDataBloodKetone,
    /// 血酮质控液
    SDCDataBloodKetoneQualityControlSolution,
    /// 所有
    SDCDataTypeAll = 0xFFFF + 1
};

NS_ASSUME_NONNULL_BEGIN

/// 年基数
extern const NSUInteger SDCBaseYear;

extern NSString * const kBMReceivedData;
extern NSString * const kBMCompleteDataLength;
extern NSString * const kBMCommand;
extern NSString * const kBMCheckByteFlag;
extern NSString * const kBMStartIndex;
extern NSString * const kBMEndIndex;
/// 测试连接
extern NSString * const SDCWriteCommandTestConnectDescription;
/// 当前测试值
extern NSString * const SDCWriteCommandCurrentTestValueDescription;
/// 读历史数据
extern NSString * const SDCWriteCommandReadHistoryDataDescription;
/// 读历史数据序列号
extern NSString * const SDCWriteCommandReadHPALCHistoryDataDescription;
/// 设置时间
extern NSString * const SDCWriteCommandSetTimeDescription;
/// 读仪器ID号
extern NSString * const SDCWriteCommandReadDeviceIdDescription;
/// 清历史数据
extern NSString * const SDCWriteCommandClearHistoryDataDescription;
/// 设置校正码
extern NSString * const SDCWriteCommandSetCorrectCodeDescription;
/// 仪器关机
extern NSString * const SDCWriteCommandShutDownDescription;
/// 仪器关蓝牙
extern NSString * const SDCWriteCommandTurnOffBluetoothDescription;
/// 读仪器SN号
extern NSString * const SDCWriteCommandReadDeviceSNDescription;
/// 读取终端记忆温度数据
extern NSString * const SDCWriteCommandReadMemTempDataDescription;
/// 删除记忆数据
extern NSString * const SDCWriteCommandDeleteMemDataDescription;
/// 开始测量
extern NSString * const SDCWriteCommandStartMeasuringDescription;
/// 停止测量
extern NSString * const SDCWriteCommandStopMeasuringDescription;
/// 当前测试值
extern NSString * const SDReciveDataCurrentTestCode;
/// 历史测试值
extern NSString * const SDReciveDataHistoryDataCode;
/// 过程值
extern NSString * const SDReciveDataProcessDataCode;
/// 历史数据补发
extern NSString * const SDReciveDataHistoryReissueDataCode;
/// 历史数据序号
extern NSString * const SDReciveDataHistorySerialNumberCode;
/// 错误信息
extern NSString * const SDReciveDataErrorCode;
/// 打开关闭声音
extern NSString * const SDCWriteCommandHPALCOpenCloseSound;
/// 获取设备时间
extern NSString * const SDReciveDataGetDeviceCode;
/// 碳系列获取仪器时间
extern NSString * const SDCWriteCommandHPALCGetDeviceTime;
/// 碳系列调节音量
extern NSString * const SDCWriteCommandHPALCAdjustVolume;
/// 碳系列读取设置信息
extern NSString * const SDCWriteCommandHPALCGetDataValue;
/// 清除历史数据code
extern NSString * const SDReciveDataClearHistoryCode;
/// 获取仪器id
extern NSString * const SDReciveDataGetDeviceIdCode;
/// 读取设置data的code
extern NSString * const SDReciveDataGetDataValueCode;
/// 正在归零
extern NSString * const SDCWriteCommandOneTestMultiZeroingDescription;
/// 归零结束
extern NSString * const SDCWriteCommandOneTestMultiEndZeroDescription;


@interface SDConstant : NSObject

@end

NS_ASSUME_NONNULL_END
